local t = Def.ActorFrame {}

t[#t+1] = Def.Actor {
	BeginCommand=function(self)
		if PROFILEMAN:IsPersistentProfile(PLAYER_1) or PROFILEMAN:IsPersistentProfile(PLAYER_2) then
			--pause double when non event
			--pausar el doble cuando no sea evento
			if IsEventMode() then
				self:sleep(2);
			else
				self:sleep(4);
			end
		end;
		self:queuecommand("Load");
	end;
	LoadCommand=function()
		SCREENMAN:GetTopScreen():Continue()
	end;
}

--if GAMESTATE:IsAnyHumanPlayerUsingMemoryCard() then
if PROFILEMAN:IsPersistentProfile(PLAYER_1) or PROFILEMAN:IsPersistentProfile(PLAYER_2) then
	local plural = GAMESTATE:GetNumPlayersEnabled() == 2 and "s" or ""
	t[#t+1] = LoadFont("ArialOutline")..{
		Text=string.format("Loading Profile%s,\nPlease wait...",plural);
		InitCommand=cmd(x,SCREEN_CENTER_X;y,75;shadowlength,0;sleep,0.5);
	}
	t[#t+1] = LoadFont("ArialOutline")..{
		InitCommand=function(self)
			(cmd(x,SCREEN_CENTER_X;y,150;shadowlength,0;diffuse,.3,.3,1,1;vertalign,top;vertspacing,20))(self);
			self:settext("Name ID\nPlay Count\nCalories\nMilleage");
		end;
	}
	t[#t+1] = LoadActor("stuff/_profilestats",PLAYER_1)..{
		InitCommand=cmd(x,SCREEN_LEFT+30;y,150;);
	}
	t[#t+1] = LoadActor("stuff/_profilestats",PLAYER_2)..{
		InitCommand=cmd(x,SCREEN_RIGHT-30;y,150;);
	}
end

return t